import { createRouter, createWebHashHistory } from 'vue-router';
import HomeView from '../views/HomeView.vue';
import RegistView from '../views/RegistView.vue';
import LoginView from '../views/LoginView.vue';
import UserView from '../views/UserView.vue';
import ShopcartView from '../views/ShopcartView.vue';
import DetailView from '../views/DetailView.vue';
import Content from '../views/Content.vue';
import List from '../views/user/List.vue';
import File from '../views/user/File.vue';
import Profile from '../views/user/Profile.vue';
import TestView from '../views/TestView.vue';
import BirthdayView from '../views/BirthdayView.vue';
import PartyView from '../views/PartyView.vue';
import ChildView from '../views/ChildView.vue';
import HotView from '../views/HotView.vue';
import NewcakesView from '../views/NewcakesView.vue';
import GoumaiView from '../views/GoumaiView.vue'

// import store from '@/store'

const routes = [{
        path: '/',
        redirect: '/home',
    },
    {
        path: '/home',
        name: 'home',
        component: HomeView,
    },
    {
        path: '/login',
        name: 'login',
        component: LoginView,
    },
    {
        path: '/regist',
        name: 'regist',
        component: RegistView,
    },
    {
        path: '/birthday',
        name: 'birthday',
        component: BirthdayView,
    },
    {
        path: '/party',
        name: 'party',
        component: PartyView,
    },
    {
        path: '/child',
        name: 'child',
        component: ChildView,
    },
    {
        path: '/hot',
        name: 'hot',
        component: HotView,
    },
    {
        path: '/newcakes',
        name: 'newcakes',
        component: NewcakesView,
    },
    {
        path: '/goumai',
        name: 'goumai',
        component: GoumaiView
    },
    {
        path: '/test',
        name: 'test',
        component: TestView,
    },
    {
        path: '/user',
        name: 'user',
        component: UserView,
        children: [{
                path: 'list',
                name: 'list',
                component: List,
            },
            {
                path: 'file/:id?',
                name: 'file',
                component: File,
            },
            {
                path: 'profile',
                name: 'profile',
                component: Profile,
            },
            {
                path: 'shopcart/:id?',
                name: 'shopcart',
                component: ShopcartView,
            },
        ],
    },
    {
        path: '/content',
        name: 'content',
        component: Content,
    },
    {
        path: '/detail/:id?',
        name: 'detail',
        component: DetailView,
    },
];

const router = createRouter({
    history: createWebHashHistory(),
    routes,
});
export default router;